<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_JS的数据类型</title>
</head>
<body>
<script>
    var a = 1;
    var b = 2.12;
    console.log(a, b);
    console.log(typeof a, typeof b);

    var c = "hello ";
    var d = 'hello ';
    console.log(c, d);
    console.log(typeof c, typeof d);

    var e = true;
    var f = false;
    console.log(e, f);
    console.log(typeof e, typeof f);

    var g;
    console.log(g, typeof g);

    let obj = {};
    console.log(obj, typeof obj);
    obj.name = "hello";
    obj.age = 18;
    console.log(obj.age, obj.name);

    let obj2 = {
        name: "hello",
        age: 18
    };
    console.log(obj2);
    console.log(obj2.name, obj2.age);
    obj2.like = "football";
    console.log(obj2);
    console.log(obj2.eat);

    let arr = [1, 2.321, '12312', true];
    console.log(arr);
    console.log(arr[0], arr[1], arr[2], arr[3]);
    console.log(arr[31111]);

    let obj1 = {
        name: "h",
        age: 18,
        score: [13, 31, 43]
    };
    let obj8 = {
        name: "l",
        age: 18,
        score: [13, 31, 43]
    };
    let obj3 = {
        name: "lo",
        age: 18,
        score: [13, 31, 43]
    };
    let obj4 = {name: "o",
        age: 18,
        score: [13, 31, 43]
    };

    console.log(Number(true));
    console.log(Number(false));
    console.log(Number(123));
    console.log(Number(123.123));
    console.log(Number("123.123123"));
    console.log(Number("hahhaha"));

    console.log(Boolean(0));
    console.log(Boolean(undefined));
    console.log(Boolean(NaN));
    console.log(Boolean(null));
    console.log(Boolean(""));
    console.log(Boolean(" "));
    console.log(Boolean("hahhaha"));
    console.log(Boolean(123));


</script>
</body>
</html>